package com.thiswhyme.republish.rabbitmq.config;

import com.thiswhyme.republish.common.CommonConstants;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Map;

/**
 * @description: org.springframework.cloud.stream.config.BindingServiceProperties增强配置
 * @author: thiswhyme
 * @date: 2021/3/22
 */
@ConfigurationProperties("spring.cloud.stream")
public class BindingServicePlusProperties {

    /**
     * BindingProperties增强配置
     */
    private Map<String, BindingPlusProperties> bindings;

    /**
     * 消息实时表名
     */
    private String messageTableName = CommonConstants.DEFAULT_RETRY_TABLENAME;

    /**
     * 消息表是否分表
     */
    private Boolean enableSharding = false;

    /**
     * 可容忍的ack响应时间，默认2000ms
     */
    private Integer ackMillis = 2000;

    public Map<String, BindingPlusProperties> getBindings() {
        return bindings;
    }

    public void setBindings(Map<String, BindingPlusProperties> bindings) {
        this.bindings = bindings;
    }

    public String getMessageTableName() {
        return messageTableName;
    }

    public void setMessageTableName(String messageTableName) {
        this.messageTableName = messageTableName;
    }

    public Boolean getEnableSharding() {
        return enableSharding;
    }

    public void setEnableSharding(Boolean enableSharding) {
        this.enableSharding = enableSharding;
    }

    public Integer getAckMillis() {
        return ackMillis;
    }

    public void setAckMillis(Integer ackMillis) {
        this.ackMillis = ackMillis;
    }
}
